package com.sgb.jicai.entity;

import com.google.gson.annotations.SerializedName;
import com.swgk.core.util.DateUtils;

public class JcChanceEntity {


    //    1 商品名
//    2 商品id（我要报价）
//    3 发起方
//    4 集采方式
//    5 发布时间
//    6 邀请时间
//    7 报价状态（状态1进行中2已完成4集采失败）
    @SerializedName("gooodsName")
    private String name;
    @SerializedName("groupBuyNO")
    private String id;
    @SerializedName("companyName")
    private String start;
    @SerializedName("groupBuyType")
    private String groupBuyType; //1 即报即采 2 汇集采购
    @SerializedName("groupBuyMode")
    private String groupBuyMode;  //1 需方发起 2 企业专项 3 供方发起
    @SerializedName("orderCreateTime")
    private String publishTime;
    @SerializedName("inviteCreateTime")
    private String inviteTime;
    @SerializedName("createCompanyNo")
    private String createCompanyNo;

    //0 已结束 1 我要加盟，我要报价 2 未开始
    @SerializedName("status")
    private int status;

    private String statusText;

    //1 报价机遇 2 加盟机遇
    private int type;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getGroupBuyMode() {
        switch (groupBuyMode){
            case "1":
                groupBuyMode = "需方发起";
                break;
            case "2":
                groupBuyMode = "企业专项";
                break;
            case "3":
                groupBuyMode = "供方发起";
                break;
        }
        return groupBuyMode;
    }

    public void setGroupBuyMode(String groupBuyMode) {
        this.groupBuyMode = groupBuyMode;
    }

    public String getStatusText() {
        switch (status) {
            case 0:
                statusText = "已结束";
                break;
            case 1:
                if (type == 1) {
                    statusText = "我要报价";
                } else {
                    statusText = "我要加盟";
                }
                break;
            default:
                statusText = "未开始";
                break;
        }
        return statusText;
    }

    public void setStatusText(String statusText) {
        this.statusText = statusText;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getStart() {
        return start;
    }

    public void setStart(String start) {
        this.start = start;
    }

    public String getGroupBuyType() {
        switch (groupBuyType){
            case "1":
                groupBuyType = "即报即采";
                break;
            case "2":
                groupBuyType = "汇集采购";
                break;
        }
        return groupBuyType;
    }

    public void setGroupBuyType(String groupBuyType) {
        this.groupBuyType = groupBuyType;
    }

    public String getPublishTime() {
        return DateUtils.timestampToDate(Long.valueOf(publishTime));
    }

    public void setPublishTime(String publishTime) {
        this.publishTime = publishTime;
    }

    public String getInviteTime() {
        return DateUtils.timestampToDate(Long.valueOf(inviteTime));
    }

    public void setInviteTime(String inviteTime) {
        this.inviteTime = inviteTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getCreateCompanyNo() {
        return createCompanyNo;
    }

    public void setCreateCompanyNo(String createCompanyNo) {
        this.createCompanyNo = createCompanyNo;
    }
}
